<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- 过滤器目前只有vue3.0在用 -->
        <p>message:{{message | capi}}</p>
    </div>

    <hr>

    <div id="app2">
        <p>{{message | capi}}</p>
    </div>

    <script src="./lib/vue.js"></script>
    <script>
        // 全局过滤器
        Vue.filter('capi', function(str) {
            return "123";
        })

        const vm = new Vue({
            el: '#app',
            data: {
                message: "hello word"
            },
            methods: {},
            filters: {
                // 过滤器函数要定义的节点
                // 私有过滤器
                // capi(message) {
                //     console.log(message);
                //     return '123';
                // }
            }
        })

        const vm2 = new Vue({
            el: '#app2',
            data: {
                message: "hello word"
            },
            methods: {},
            filters: {}
        })
    </script>
</body>

</html>